package io.dy.listener;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @author : dmj
 * @date: 2024/8/27 3:18 下午
 * @description: 简单消费者(监听者)
 */
@Component
@RocketMQMessageListener(topic = "bootTopic", consumerGroup = "boot-consumer-group")
public class SimpleListener implements RocketMQListener<String> {

    /**
     * 消费者方法
     * @param msg 消息内容
     */
    @Override
    public void onMessage(String msg) {
        System.out.println("SimpleListener 接收到的消息: " + msg);
    }
}
